<?php

use  yii\helpers\Url;
use  yii\helpers\Html;

$one           = \backend\modules\models\setting\Menu::findOne(['name' => '党群工作', 'parent_id' => 0]);
$content_one   = $one->getAllContents(7);
$two           = \backend\modules\models\setting\Menu::findOne(['name' => '企业文化', 'parent_id' => 0]);
$content_two   = $two->getAllContents(7);
$three         = \backend\modules\models\setting\Menu::findOne(['name' => '社会责任', 'parent_id' => 0]);
$content_three = $three->getAllContents(7);
?>
<div class="container-lg last-panel-container">
	<div class="row">
		<div class="col-md-4 news-panel-wrap">
			<div class="row news-panel">
				<div class="col-md-12">
					<div class="model-title">
						<div>党群工作</div>
						<div class="en-name">party mass work</div>
						<div class="line-wrap"><img src="assets/title-img.png" alt="">
							<div class="title-line"></div>
						</div>
						<a href="<?= Url::to(['site/menu', 'menu_id' => $one ? $one->id : 0]) ?>" class="a-more">更多<i class="iconfont icon-double-arrow"></i></a>
					</div>
				</div>
				<div class="container-fluid news-wrap">
					<div class="new-list-top-panel">
						<div class="card mb-3">
							<div class="row no-gutters">
								<?php if ($content_one) {?>
									<div class="col-md-6">
										<img src="<?= Html::encode($content_one[0]->image)?>" alt="<?= Html::encode($content_one[0]->resume)?>">
									</div>
									<div class="col-md-6">
										<div class="card-body">
											<h5 class="card-title text-center" title="<?= Html::encode($content_one[0]->title)?>"><?= Html::encode($content_one[0]->title)?></h5>
											<p class="card-text card-text1"><?= Html::encode($content_one[0]->resume)?></p>
											<p class="card-text card-text2 text-right"><a href="<?= Url::to(['site/content','content_id'=>$content_one[0]->id])?>">立即查看</a></p>
										</div>
									</div>
								<?php }?>
							</div>
						</div>
					</div>
					<?php
						if($content_one){
							unset($content_one[0]);
						}
					?>
					<ul class="list-unstyled">
						<?php if ($content_one) {?>
							<?php foreach ($content_one as $one => $first): ?>
								<li class="new-item">
									<div><img src="assets/item-img.png" alt=""><a href="<?= Url::to(['site/content','content_id'=>$first->id])?>"><?= Html::encode($first->title)?></a></div>
									<div><?= Html::encode(date('Y-m-d',strtotime($first->create_time)))?></div>
								</li>
							<?php endforeach ?>
						<?php }?>
					</ul>
				</div>
			</div>
		</div>
		<div class="col-md-4 news-panel-wrap">
			<div class="row news-panel">
				<div class="col-md-12">
					<div class="model-title">
						<div>企业文化</div>
						<div class="en-name">Corporate culture</div>
						<div class="line-wrap"><img src="assets/title-img.png" alt="">
							<div class="title-line"></div>
						</div>
						<a href="<?= Url::to(['site/menu', 'menu_id' => $two ? $two->id : 0]) ?>" class="a-more">更多<i class="iconfont icon-double-arrow"></i></a>
					</div>
				</div>
				<div class="container-fluid news-wrap">
					<div class="new-list-top-panel">
						<div class="card mb-3">
							<div class="row no-gutters">
								<?php if ($content_two) {?>
									<div class="col-md-6">
										<img src="<?= Html::encode($content_two[0]->image)?>" alt="<?= Html::encode($content_two[0]->resume)?>">
									</div>
									<div class="col-md-6">
										<div class="card-body">
											<h5 class="card-title text-center"><?= Html::encode($content_two[0]->title)?></h5>
											<p class="card-text card-text1"><?= Html::encode($content_two[0]->resume)?></p>
											<p class="card-text card-text2 text-right"><a href="<?= Url::to(['site/content','content_id'=>$content_two[0]->id])?>">立即查看</a></p>
										</div>
									</div>
								<?php }?>
							</div>
						</div>
					</div>
					<?php
						if($content_two){
							unset($content_two[0]);
						}
					?>
					<ul class="list-unstyled">
						<?php if ($content_two) {?>
							<?php foreach ($content_two as $two => $second): ?>
								<li class="new-item">
									<div><img src="assets/item-img.png" alt=""><a href="<?= Url::to(['site/content','content_id'=>$second->id])?>"><?= Html::encode($second->title)?></a></div>
									<div><?= Html::encode(date('Y-m-d',strtotime($second->create_time)))?></div>
								</li>
							<?php endforeach ?>
						<?php }?>
					</ul>
				</div>
			</div>
		</div>
		<div class="col-md-4 news-panel-wrap">
			<div class="row news-panel">
				<div class="col-md-12">
					<div class="model-title">
						<div>社会责任</div>
						<div class="en-name">Social responsibility</div>
						<div class="line-wrap"><img src="assets/title-img.png" alt="">
							<div class="title-line"></div>
						</div>
						<a href="<?= Url::to(['site/menu', 'menu_id' => $three ? $three->id : 0]) ?>" class="a-more">更多<i class="iconfont icon-double-arrow"></i></a>
					</div>
				</div>
				<div class="container-fluid news-wrap">
					<?php if ($content_three) {?>
						<?php foreach ($content_three as $three => $third): ?>
							<li class="new-item">
								<div><img src="assets/item-img.png" alt=""><a href="<?= Url::to(['site/content','content_id'=>$third->id])?>"><?= Html::encode($third->title)?></a></div>
								<div><?= Html::encode(date('Y-m-d',strtotime($third->create_time)))?></div>
							</li>
						<?php endforeach ?>
					<?php }?>
				</div>
			</div>
		</div>
	</div>
</div>